import datetime

from flask.cli import AppGroup
from sqlalchemy import Delete
from applications.extensions import db
from applications.models import *
#此脚本是为了添加测试数据的
admin_cli = AppGroup("admin")

now_time = datetime.datetime.now()
userdata = [
    User(
        id=1,
        username='admin',
        password_hash='pbkdf2:sha256:150000$raM7mDSr$58fe069c3eac01531fc8af85e6fc200655dd2588090530084d182e6ec9d52c85',
        create_at=now_time,
        enable=1,
        realname='超级管理',
        remark='要是不能把握时机，就要终身蹭蹬，一事无成！',
        avatar='/static/system/admin/images/avatar.jpg',
        dept_id=1,
    ),
    User(
        id=2,
        username='库管员-张三',
        password_hash='pbkdf2:sha256:150000$cRS8bYNh$adb57e64d929863cf159f924f74d0634f1fecc46dba749f1bfaca03da6d2e3ac',
        create_at=now_time,
        enable=1,
        realname='测试',
        remark='要是不能把握时机，就要终身蹭蹬，一事无成！',
        avatar='/static/system/admin/images/avatar.jpg',
        dept_id=1,
    ),
    User(
        id='3',
        username='QA-1',
        password_hash='pbkdf2:sha256:150000$skME1obT$6a2c20cd29f89d7d2f21d9e373a7e3445f70ebce3ef1c3a555e42a7d17170b37',
        create_at=now_time,
        enable=1,
        realname='风',
        remark='要是不能把握时机，就要终身蹭蹬，一事无成！',
        avatar='/static/system/admin/images/avatar.jpg',
        dept_id=7,
    ),User(
        id='4',
        username='QA-2',
        password_hash='pbkdf2:sha256:150000$skME1obT$6a2c20cd29f89d7d2f21d9e373a7e3445f70ebce3ef1c3a555e42a7d17170b37',
        create_at=now_time,
        enable=1,
        realname='风',
        remark='要是不能把握时机，就要终身蹭蹬，一事无成！',
        avatar='/static/system/admin/images/avatar.jpg',
        dept_id=7,
    ),User(
        id='5',
        username='QA-2',
        password_hash='pbkdf2:sha256:150000$skME1obT$6a2c20cd29f89d7d2f21d9e373a7e3445f70ebce3ef1c3a555e42a7d17170b37',
        create_at=now_time,
        enable=1,
        realname='风',
        remark='要是不能把握时机，就要终身蹭蹬，一事无成！',
        avatar='/static/system/admin/images/avatar.jpg',
        dept_id=7,
    )
]
roledata = [
    Role(
        id=1,
        code='admin',
        name='管理员',
        enable=1,
        details='管理员',
        sort=1,
        create_time=now_time,
    ),
    Role(
        id=2,
        code='common',
        name='普通用户',
        enable=1,
        details='只有查看，没有增删改权限',
        sort=2,
        create_time=now_time,
    )
]
deptdata = [
    Dept(
        id=1,
        parent_id=0,
        dept_name='总公司',
        sort=1,
        leader='就眠仪式',
        phone='12312345679',
        email='123qq.com',
        status=1,
        remark='这是总公司',
        create_at=now_time
    ),
    Dept(
        id=4,
        parent_id=1,
        dept_name='济南分公司',
        sort=2,
        leader='就眠仪式',
        phone='12312345679',
        email='123qq.com',
        status=1,
        remark='这是济南',
        create_at=now_time

    ),
    Dept(
        id=5,
        parent_id=1,
        dept_name='唐山分公司',
        sort=4,
        leader='mkg',
        phone='12312345679',
        email='123qq.com',
        status=1,
        remark='这是唐山',
        create_at=now_time

    ),
    Dept(
        id=7,
        parent_id=4,
        dept_name='济南分公司开发部',
        sort=5,
        leader='就眠仪式',
        phone='12312345679',
        email='123qq.com',
        status=1,
        remark='测试',
        create_at=now_time

    ),
    Dept(
        id=8,
        parent_id=5,
        dept_name='唐山测试部',
        sort=5,
        leader='mkg',
        phone='12312345679',
        email='123qq.com',
        status=1,
        remark='测试部',
        create_at=now_time

    )
]
powerdata = [
    Power(
        id=1,
        name='系统管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon-set-fill',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=3,
        name='用户管理',
        type='1',
        code='system:user:main',
        url='/system/user/',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=4,
        name='权限管理',
        type='1',
        code='system:power:main',
        url='/system/power/',
        open_type='_iframe',
        parent_id='1',
        icon=None,
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=9,
        name='角色管理',
        type='1',
        code='system:role:main',
        url='/system/role',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon layui-icon-username',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=12,
        name='系统监控',
        type='1',
        code='system:monitor:main',
        url='/system/monitor',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon layui-icon-vercode',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=13,
        name='日志管理',
        type='1',
        code='system:log:main',
        url='/system/log',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon layui-icon-read',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=17,
        name='文件管理',
        type='0',
        code='',
        url='',
        open_type='',
        parent_id='0',
        icon='layui-icon layui-icon-camera',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=18,
        name='图片上传',
        type='1',
        code='system:file:main',
        url='/system/file',
        open_type='_iframe',
        parent_id='17',
        icon='layui-icon layui-icon-camera',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=21,
        name='权限增加',
        type='2',
        code='system:power:add',
        url='',
        open_type='',
        parent_id='4',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=22,
        name='用户增加',
        type='2',
        code='system:user:add',
        url='',
        open_type='',
        parent_id='3',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=23,
        name='用户编辑',
        type='2',
        code='system:user:edit',
        url='',
        open_type='',
        parent_id='3',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=24,
        name='用户删除',
        type='2',
        code='system:user:remove',
        url='',
        open_type='',
        parent_id='3',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=25,
        name='权限编辑',
        type='2',
        code='system:power:edit',
        url='',
        open_type='',
        parent_id='4',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=26,
        name='用户删除',
        type='2',
        code='system:power:remove',
        url='',
        open_type='',
        parent_id='4',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=27,
        name='用户增加',
        type='2',
        code='system:role:add',
        url='',
        open_type='',
        parent_id='9',
        icon='',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=28,
        name='角色编辑',
        type='2',
        code='system:role:edit',
        url='',
        open_type='',
        parent_id='9',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=29,
        name='角色删除',
        type='2',
        code='system:role:remove',
        url='',
        open_type='',
        parent_id='9',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=30,
        name='角色授权',
        type='2',
        code='system:role:power',
        url='',
        open_type='',
        parent_id='9',
        icon='',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=31,
        name='图片增加',
        type='2',
        code='system:file:add',
        url='',
        open_type='',
        parent_id='18',
        icon='',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=32,
        name='图片删除',
        type='2',
        code='system:file:delete',
        url='',
        open_type='',
        parent_id='18',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=44,
        name='数据字典',
        type='1',
        code='system:dict:main',
        url='/system/dict',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon layui-icon-console',
        sort=6,
        create_time=now_time,
        enable=1,

    ), Power(
        id=45,
        name='字典增加',
        type='2',
        code='system:dict:add',
        url='',
        open_type='',
        parent_id='44',
        icon='',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=46,
        name='字典修改',
        type='2',
        code='system:dict:edit',
        url='',
        open_type='',
        parent_id='44',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=47,
        name='字典删除',
        type='2',
        code='system:dict:remove',
        url='',
        open_type='',
        parent_id='44',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=48,
        name='部门管理',
        type='1',
        code='system:dept:main',
        url='/system/dept',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon layui-icon-group',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=49,
        name='部门增加',
        type='2',
        code='system:dept:add',
        url='',
        open_type='',
        parent_id='48',
        icon='',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=50,
        name='部门编辑',
        type='2',
        code='system:dept:edit',
        url='',
        open_type='',
        parent_id='48',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=51,
        name='部门删除',
        type='2',
        code='system:dept:remove',
        url='',
        open_type='',
        parent_id='48',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=57,
        name='邮件管理',
        type='1',
        code='system:mail:main',
        url='/system/mail',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon ',
        sort=7,
        create_time=now_time,
        enable=1,

    ), Power(
        id=58,
        name='邮件发送',
        type='2',
        code='system:mail:add',
        url='',
        open_type='',
        parent_id='57',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=59,
        name='邮件删除',
        type='2',
        code='system:mail:remove',
        url='',
        open_type='',
        parent_id='57',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=60,
        name='追溯管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon-set-fill',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=61,
        name='生产管理',
        type='1',
        code='traceability:production:main',
        url='/traceability/production',
        open_type='_iframe',
        parent_id='60',
        icon='layui-icon ',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=62,
        name='生产增加',
        type='2',
        code='traceability:production:add',
        url='',
        open_type='',
        parent_id='61',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=63,
        name='生产修改',
        type='2',
        code='traceability:production:edit',
        url='',
        open_type='',
        parent_id='61',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=64,
        name='生产删除',
        type='2',
        code='traceability:production:remove',
        url='',
        open_type='',
        parent_id='61',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=65,
        name='报表管理',
        type='1',
        code='system:report:main',
        url='/system/report',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon ',
        sort=8,
        create_time=now_time,
        enable=1,

    ), Power(
        id=66,
        name='报表增加',
        type='2',
        code='system:report:add',
        url='',
        open_type='',
        parent_id='65',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=67,
        name='报表删除',
        type='2',
        code='system:report:remove',
        url='',
        open_type='',
        parent_id='65',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=68,
        name='报表修改',
        type='2',
        code='system:report:edit',
        url='',
        open_type='',
        parent_id='65',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ),Power(
        id=69,
        name='商品档案',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon-set-fill',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=70,
        name='YP原料档案',
        type='1',
        code='goodsfiles:raw:main:yp',
        url='/goodsfiles/raw/yp',
        open_type='_iframe',
        parent_id='69',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=71,
        name='YP原料档案增加',
        type='2',
        code='goodsfiles:raw:add:yp',
        url='',
        open_type='',
        parent_id='70',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=72,
        name='YP原料档案删除',
        type='2',
        code='goodsfiles:raw:remove:yp',
        url='',
        open_type='',
        parent_id='70',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=73,
        name='YP原料档案修改',
        type='2',
        code='goodsfiles:raw:edit:yp',
        url='',
        open_type='',
        parent_id='70',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=74,
        name='YP辅料档案',
        type='1',
        code='goodsfiles:auxiliary:main:yp',
        url='/goodsfiles/auxiliary/yp',
        open_type='_iframe',
        parent_id='69',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=75,
        name='YP辅料档案增加',
        type='2',
        code='goodsfiles:auxiliary:add:yp',
        url='',
        open_type='',
        parent_id='74',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=76,
        name='YP辅料档案删除',
        type='2',
        code='goodsfiles:auxiliary:remove:yp',
        url='',
        open_type='',
        parent_id='74',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=77,
        name='YP辅料档案修改',
        type='2',
        code='goodsfiles:auxiliary:edit:yp',
        url='',
        open_type='',
        parent_id='74',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=78,
        name='YP包材档案',
        type='1',
        code='goodsfiles:packaging:main:yp',
        url='/goodsfiles/packaging/yp',
        open_type='_iframe',
        parent_id='69',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=79,
        name='YP包材档案增加',
        type='2',
        code='goodsfiles:packaging:add:yp',
        url='',
        open_type='',
        parent_id='78',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=80,
        name='YP包材档案删除',
        type='2',
        code='goodsfiles:packaging:remove:yp',
        url='',
        open_type='',
        parent_id='78',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=81,
        name='YP包材档案修改',
        type='2',
        code='goodsfiles:packaging:edit:yp',
        url='',
        open_type='',
        parent_id='78',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=82,
        name='YP成品档案',
        type='1',
        code='goodsfiles:finished:main:yp',
        url='/goodsfiles/finished/yp',
        open_type='_iframe',
        parent_id='69',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=83,
        name='YP成品档案增加',
        type='2',
        code='goodsfiles:finished:add:yp',
        url='',
        open_type='',
        parent_id='82',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=84,
        name='YP成品档案删除',
        type='2',
        code='goodsfiles:finished:remove:yp',
        url='',
        open_type='',
        parent_id='82',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=85,
        name='YP成品档案修改',
        type='2',
        code='goodsfiles:finished:edit:yp',
        url='',
        open_type='',
        parent_id='82',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=86,
        name='YP中间品档案',
        type='1',
        code='goodsfiles:intermediate:main:yp',
        url='/goodsfiles/intermediate/yp',
        open_type='_iframe',
        parent_id='69',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=87,
        name='YP中间品档案增加',
        type='2',
        code='goodsfiles:intermediate:add:yp',
        url='',
        open_type='',
        parent_id='86',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=88,
        name='YP中间品档案删除',
        type='2',
        code='goodsfiles:intermediate:remove:yp',
        url='',
        open_type='',
        parent_id='86',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=89,
        name='YP中间品档案修改',
        type='2',
        code='goodsfiles:intermediate:edit:yp',
        url='',
        open_type='',
        parent_id='86',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ),Power(
        id=90,
        name='供应商档案',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon-set-fill',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=91,
        name='YP原料供应商',
        type='1',
        code='supplier:raw:main:yp',
        url='/supplier/raw/yp',
        open_type='_iframe',
        parent_id='90',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=92,
        name='YP原料供应商增加',
        type='2',
        code='supplier:raw:add:yp',
        url='',
        open_type='',
        parent_id='91',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=93,
        name='YP原料供应商删除',
        type='2',
        code='supplier:raw:remove:yp',
        url='',
        open_type='',
        parent_id='91',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=94,
        name='YP原料供应商修改',
        type='2',
        code='supplier:raw:edit:yp',
        url='',
        open_type='',
        parent_id='91',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=95,
        name='YP辅料供应商',
        type='1',
        code='supplier:auxiliary:main:yp',
        url='/supplier/auxiliary/yp',
        open_type='_iframe',
        parent_id='90',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=96,
        name='YP辅料供应商增加',
        type='2',
        code='supplier:auxiliary:add:yp',
        url='',
        open_type='',
        parent_id='95',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=97,
        name='YP辅料供应商删除',
        type='2',
        code='supplier:auxiliary:remove:yp',
        url='',
        open_type='',
        parent_id='95',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=98,
        name='YP辅料供应商修改',
        type='2',
        code='supplier:auxiliary:edit:yp',
        url='',
        open_type='',
        parent_id='95',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=99,
        name='YP包材供应商',
        type='1',
        code='supplier:packaging:main:yp',
        url='/supplier/packaging/yp',
        open_type='_iframe',
        parent_id='90',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=100,
        name='YP包材供应商增加',
        type='2',
        code='supplier:packaging:add:yp',
        url='',
        open_type='',
        parent_id='99',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=101,
        name='YP包材供应商删除',
        type='2',
        code='supplier:packaging:remove:yp',
        url='',
        open_type='',
        parent_id='99',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=102,
        name='YP包材供应商修改',
        type='2',
        code='supplier:packaging:edit:yp',
        url='',
        open_type='',
        parent_id='99',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=103,
        name='工具管理',
        type='1',
        code='system:tools:main',
        url='/system/tools',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon ',
        sort=9,
        create_time=now_time,
        enable=1,

    ), Power(
        id=104,
        name='工具增加',
        type='2',
        code='system:tools:add',
        url='',
        open_type='',
        parent_id='103',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=105,
        name='工具删除',
        type='2',
        code='system:tools:remove',
        url='',
        open_type='',
        parent_id='103',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=106,
        name='工具修改',
        type='2',
        code='system:tools:edit',
        url='',
        open_type='',
        parent_id='103',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=107,
        name='系统配置',
        type='1',
        code='system:config:main',
        url='/system/config/',
        open_type='_iframe',
        parent_id='1',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=11,
        create_time=now_time,
        enable=1,

    ), Power(
        id=108,
        name='配置增加',
        type='2',
        code='system:config:add',
        url='',
        open_type='',
        parent_id='107',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=109,
        name='配置删除',
        type='2',
        code='system:config:remove',
        url='',
        open_type='',
        parent_id='107',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=110,
        name='配置修改',
        type='2',
        code='system:config:edit',
        url='',
        open_type='',
        parent_id='107',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ),Power(
        id=111,
        name='客户档案',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon-set-fill',
        sort=6,
        create_time=now_time,
        enable=1,

    ), Power(
        id=112,
        name='YP成品客户档案',
        type='1',
        code='customer:finished:main:yp',
        url='/customer/finished/yp/',
        open_type='_iframe',
        parent_id='111',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=113,
        name='YP成品客户档案增加',
        type='2',
        code='customer:finished:add:yp',
        url='',
        open_type='',
        parent_id='112',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=114,
        name='YP成品客户档案删除',
        type='2',
        code='customer:finished:remove:yp',
        url='',
        open_type='',
        parent_id='112',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=115,
        name='YP成品客户档案修改',
        type='2',
        code='customer:finished:edit:yp',
        url='',
        open_type='',
        parent_id='112',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=116,
        name='YP原料客户档案',
        type='1',
        code='customer:raw:main:yp',
        url='/customer/raw/yp/',
        open_type='_iframe',
        parent_id='111',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=117,
        name='YP原料客户档案增加',
        type='2',
        code='customer:raw:add:yp',
        url='',
        open_type='',
        parent_id='116',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=118,
        name='YP原料客户档案删除',
        type='2',
        code='customer:raw:remove:yp',
        url='',
        open_type='',
        parent_id='116',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=119,
        name='YP原料客户档案修改',
        type='2',
        code='customer:raw:edit:yp',
        url='',
        open_type='',
        parent_id='116',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=120,
        name='货位档案',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon-set-fill',
        sort=7,
        create_time=now_time,
        enable=1,

    ), Power(
        id=121,
        name='YP原料货位',
        type='1',
        code='location:raw:main:yp',
        url='/location/raw/yp',
        open_type='_iframe',
        parent_id='120',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=122,
        name='YP原料货位增加',
        type='2',
        code='location:raw:add:yp',
        url='',
        open_type='',
        parent_id='121',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=123,
        name='YP原料货位删除',
        type='2',
        code='location:raw:remove:yp',
        url='',
        open_type='',
        parent_id='121',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=124,
        name='YP原料货位修改',
        type='2',
        code='location:raw:edit:yp',
        url='',
        open_type='',
        parent_id='121',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=125,
        name='YP辅料货位',
        type='1',
        code='location:auxiliary:main:yp',
        url='/location/auxiliary/yp',
        open_type='_iframe',
        parent_id='120',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=126,
        name='YP辅料货位增加',
        type='2',
        code='location:auxiliary:add:yp',
        url='',
        open_type='',
        parent_id='125',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=127,
        name='YP辅料货位删除',
        type='2',
        code='location:auxiliary:remove:yp',
        url='',
        open_type='',
        parent_id='125',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=128,
        name='YP辅料货位修改',
        type='2',
        code='location:auxiliary:edit:yp',
        url='',
        open_type='',
        parent_id='125',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=129,
        name='YP包材货位',
        type='1',
        code='location:packaging:main:yp',
        url='/location/packaging/yp',
        open_type='_iframe',
        parent_id='120',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=130,
        name='YP包材货位增加',
        type='2',
        code='location:packaging:add:yp',
        url='',
        open_type='',
        parent_id='129',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=131,
        name='YP包材货位删除',
        type='2',
        code='location:packaging:remove:yp',
        url='',
        open_type='',
        parent_id='129',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=132,
        name='YP包材货位修改',
        type='2',
        code='location:packaging:edit:yp',
        url='',
        open_type='',
        parent_id='129',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=133,
        name='YP中间品货位',
        type='1',
        code='location:intermediate:main:yp',
        url='/location/intermediate/yp',
        open_type='_iframe',
        parent_id='120',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=134,
        name='YP中间品货位增加',
        type='2',
        code='location:intermediate:add:yp',
        url='',
        open_type='',
        parent_id='133',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=135,
        name='YP中间品货位删除',
        type='2',
        code='location:intermediate:remove:yp',
        url='',
        open_type='',
        parent_id='133',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=136,
        name='YP中间品货位修改',
        type='2',
        code='location:intermediate:edit:yp',
        url='',
        open_type='',
        parent_id='121',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=137,
        name='YP成品货位',
        type='1',
        code='location:finished:main:yp',
        url='/location/finished/yp',
        open_type='_iframe',
        parent_id='120',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=138,
        name='YP成品货位增加',
        type='2',
        code='location:finished:add:yp',
        url='',
        open_type='',
        parent_id='137',
        icon='layui-icon layui-icon-ok-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=139,
        name='YP成品货位删除',
        type='2',
        code='location:finished:remove:yp',
        url='',
        open_type='',
        parent_id='137',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=140,
        name='YP成品货位修改',
        type='2',
        code='location:finished:edit:yp',
        url='',
        open_type='',
        parent_id='137',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=141,
        name='用户权限',
        type='2',
        code='user:power',
        url='',
        open_type='',
        parent_id='1',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=142,
        name='YP原料库管员',
        type='2',
        code='user:power:raw:yp:keeper',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=143,
        name='YP原料QA',
        type='2',
        code='user:power:raw:yp:qa',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=144,
        name='YP原料采购员',
        type='2',
        code='user:power:raw:yp:buyer',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ),Power(
        id=145,
        name='入库管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon-set-fill',
        sort=8,
        create_time=now_time,
        enable=1,

    ), Power(
        id=146,
        name='YP原料入库',
        type='1',
        code='store:raw:main:yp',
        url='/store/raw/yp/',
        open_type='_iframe',
        parent_id='145',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=147,
        name='YP原料入库增加',
        type='2',
        code='store:raw:add:yp',
        url='',
        open_type='',
        parent_id='146',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=148,
        name='YP原料入库编辑',
        type='2',
        code='store:raw:edit:yp',
        url='',
        open_type='',
        parent_id='146',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=149,
        name='YP原料入库删除',
        type='2',
        code='store:raw:remove:yp',
        url='',
        open_type='',
        parent_id='146',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=150,
        name='YP辅料入库',
        type='1',
        code='store:auxiliary:main:yp',
        url='/store/auxiliary/yp/',
        open_type='_iframe',
        parent_id='145',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=151,
        name='YP辅料入库增加',
        type='2',
        code='store:auxiliary:add:yp',
        url='',
        open_type='',
        parent_id='150',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=152,
        name='YP辅料入库编辑',
        type='2',
        code='store:auxiliary:edit:yp',
        url='',
        open_type='',
        parent_id='150',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=153,
        name='YP辅料入库删除',
        type='2',
        code='store:auxiliary:remove:yp',
        url='',
        open_type='',
        parent_id='150',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=154,
        name='YP包材入库',
        type='1',
        code='store:packaging:main:yp',
        url='/store/packaging/yp/',
        open_type='_iframe',
        parent_id='145',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=155,
        name='YP包材入库增加',
        type='2',
        code='store:packaging:add:yp',
        url='',
        open_type='',
        parent_id='154',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=156,
        name='YP包材入库编辑',
        type='2',
        code='store:packaging:edit:yp',
        url='',
        open_type='',
        parent_id='154',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=157,
        name='YP包材入库删除',
        type='2',
        code='store:packaging:remove:yp',
        url='',
        open_type='',
        parent_id='154',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=158,
        name='YP中间品入库',
        type='1',
        code='store:intermediate:main:yp',
        url='/store/intermediate/yp/',
        open_type='_iframe',
        parent_id='145',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=159,
        name='YP中间品入库增加',
        type='2',
        code='store:intermediate:add:yp',
        url='',
        open_type='',
        parent_id='158',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=160,
        name='YP中间品入库编辑',
        type='2',
        code='store:intermediate:edit:yp',
        url='',
        open_type='',
        parent_id='158',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=161,
        name='YP中间品入库删除',
        type='2',
        code='store:intermediate:remove:yp',
        url='',
        open_type='',
        parent_id='158',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=162,
        name='YP成品入库',
        type='1',
        code='store:finished:main:yp',
        url='/store/finished/yp/',
        open_type='_iframe',
        parent_id='145',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=163,
        name='YP成品入库增加',
        type='2',
        code='store:finished:add:yp',
        url='',
        open_type='',
        parent_id='162',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=164,
        name='YP成品入库编辑',
        type='2',
        code='store:finished:edit:yp',
        url='',
        open_type='',
        parent_id='162',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=165,
        name='YP成品入库删除',
        type='2',
        code='store:finished:remove:yp',
        url='',
        open_type='',
        parent_id='162',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=166,
        name='入库退货管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=9,
        create_time=now_time,
        enable=1,

    ), Power(
        id=167,
        name='YP原料入库退货',
        type='1',
        code='store:raw:return:main:yp',
        url='/store/raw/return/yp/',
        open_type='_iframe',
        parent_id='166',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=168,
        name='YP原料入库退货增加',
        type='2',
        code='store:raw:return:add:yp',
        url='',
        open_type='',
        parent_id='167',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=169,
        name='YP原料入库退货编辑',
        type='2',
        code='store:raw:return:edit:yp',
        url='',
        open_type='',
        parent_id='167',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=170,
        name='YP原料入库退货删除',
        type='2',
        code='store:raw:return:remove:yp',
        url='',
        open_type='',
        parent_id='167',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=171,
        name='YP辅料入库退货',
        type='1',
        code='store:auxiliary:return:main:yp',
        url='/store/auxiliary/return/yp/',
        open_type='_iframe',
        parent_id='166',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=172,
        name='YP辅料入库退货增加',
        type='2',
        code='store:auxiliary:return:add:yp',
        url='',
        open_type='',
        parent_id='171',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=173,
        name='YP辅料入库退货编辑',
        type='2',
        code='store:auxiliary:return:edit:yp',
        url='',
        open_type='',
        parent_id='171',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=174,
        name='YP辅料入库退货删除',
        type='2',
        code='store:auxiliary:return:remove:yp',
        url='',
        open_type='',
        parent_id='171',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=175,
        name='YP包材入库退货',
        type='1',
        code='store:packaging:return:main:yp',
        url='/store/packaging/return/yp/',
        open_type='_iframe',
        parent_id='166',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=176,
        name='YP包材入库退货增加',
        type='2',
        code='store:packaging:return:add:yp',
        url='',
        open_type='',
        parent_id='175',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=177,
        name='YP包材入库退货编辑',
        type='2',
        code='store:packaging:return:edit:yp',
        url='',
        open_type='',
        parent_id='175',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=178,
        name='YP包材入库退货删除',
        type='2',
        code='store:packaging:return:remove:yp',
        url='',
        open_type='',
        parent_id='175',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=179,
        name='报损管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=10,
        create_time=now_time,
        enable=1,

    ), Power(
        id=180,
        name='YP原料报损管理',
        type='1',
        code='store:raw:loss:main:yp',
        url='/store/raw/loss/yp/',
        open_type='_iframe',
        parent_id='179',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=181,
        name='YP原料报损管理增加',
        type='2',
        code='store:raw:loss:add:yp',
        url='',
        open_type='',
        parent_id='180',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=182,
        name='YP原料报损管理编辑',
        type='2',
        code='store:raw:loss:edit:yp',
        url='',
        open_type='',
        parent_id='180',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=183,
        name='YP原料报损管理删除',
        type='2',
        code='store:raw:loss:remove:yp',
        url='',
        open_type='',
        parent_id='180',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=184,
        name='YP辅料报损管理',
        type='1',
        code='store:auxiliary:loss:main:yp',
        url='/store/auxiliary/loss/yp/',
        open_type='_iframe',
        parent_id='179',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=185,
        name='YP辅料报损管理增加',
        type='2',
        code='store:auxiliary:loss:add:yp',
        url='',
        open_type='',
        parent_id='184',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=186,
        name='YP辅料报损管理编辑',
        type='2',
        code='store:auxiliary:loss:edit:yp',
        url='',
        open_type='',
        parent_id='184',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=187,
        name='YP辅料报损管理删除',
        type='2',
        code='store:auxiliary:loss:remove:yp',
        url='',
        open_type='',
        parent_id='184',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=188,
        name='YP包材报损管理',
        type='1',
        code='store:packaging:loss:main:yp',
        url='/store/packaging/loss/yp/',
        open_type='_iframe',
        parent_id='179',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=189,
        name='YP包材报损管理增加',
        type='2',
        code='store:packaging:loss:add:yp',
        url='',
        open_type='',
        parent_id='188',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=190,
        name='YP包材报损管理编辑',
        type='2',
        code='store:packaging:loss:edit:yp',
        url='',
        open_type='',
        parent_id='188',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=191,
        name='YP包材报损管理删除',
        type='2',
        code='store:packaging:loss:remove:yp',
        url='',
        open_type='',
        parent_id='188',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ) ,Power(
        id=192,
        name='YP中间品报损管理',
        type='1',
        code='store:intermediate:loss:main:yp',
        url='/store/intermediate/loss/yp/',
        open_type='_iframe',
        parent_id='179',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=193,
        name='YP中间品报损管理增加',
        type='2',
        code='store:intermediate:loss:add:yp',
        url='',
        open_type='',
        parent_id='192',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=194,
        name='YP中间品报损管理编辑',
        type='2',
        code='store:intermediate:loss:edit:yp',
        url='',
        open_type='',
        parent_id='192',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=195,
        name='YP中间品报损管理删除',
        type='2',
        code='store:intermediate:loss:remove:yp',
        url='',
        open_type='',
        parent_id='192',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=196,
        name='YP成品报损管理',
        type='1',
        code='store:finished:loss:main:yp',
        url='/store/finished/loss/yp/',
        open_type='_iframe',
        parent_id='179',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=197,
        name='YP成品报损管理增加',
        type='2',
        code='store:finished:loss:add:yp',
        url='',
        open_type='',
        parent_id='196',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=198,
        name='YP成品报损管理编辑',
        type='2',
        code='store:finished:loss:edit:yp',
        url='',
        open_type='',
        parent_id='196',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=199,
        name='YP成品报损管理删除',
        type='2',
        code='store:finished:loss:remove:yp',
        url='',
        open_type='',
        parent_id='196',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=200,
        name='报溢管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=11,
        create_time=now_time,
        enable=1,

    ), Power(
        id=201,
        name='YP原料报溢管理',
        type='1',
        code='store:raw:excess:main:yp',
        url='/store/raw/excess/yp/',
        open_type='_iframe',
        parent_id='200',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=202,
        name='YP原料报溢管理增加',
        type='2',
        code='store:raw:excess:add:yp',
        url='',
        open_type='',
        parent_id='201',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=203,
        name='YP原料报溢管理编辑',
        type='2',
        code='store:raw:excess:edit:yp',
        url='',
        open_type='',
        parent_id='201',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=204,
        name='YP原料报溢管理删除',
        type='2',
        code='store:raw:excess:remove:yp',
        url='',
        open_type='',
        parent_id='201',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=205,
        name='YP辅料报溢管理',
        type='1',
        code='store:auxiliary:excess:main:yp',
        url='/store/auxiliary/excess/yp/',
        open_type='_iframe',
        parent_id='200',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=206,
        name='YP辅料报溢管理增加',
        type='2',
        code='store:auxiliary:excess:add:yp',
        url='',
        open_type='',
        parent_id='205',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=207,
        name='YP辅料报溢管理编辑',
        type='2',
        code='store:auxiliary:excess:edit:yp',
        url='',
        open_type='',
        parent_id='205',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=208,
        name='YP辅料报溢管理删除',
        type='2',
        code='store:auxiliary:excess:remove:yp',
        url='',
        open_type='',
        parent_id='205',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=209,
        name='YP包材报溢管理',
        type='1',
        code='store:packaging:excess:main:yp',
        url='/store/packaging/excess/yp/',
        open_type='_iframe',
        parent_id='200',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=210,
        name='YP包材报溢管理增加',
        type='2',
        code='store:packaging:excess:add:yp',
        url='',
        open_type='',
        parent_id='209',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=211,
        name='YP包材报溢管理编辑',
        type='2',
        code='store:packaging:excess:edit:yp',
        url='',
        open_type='',
        parent_id='209',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=212,
        name='YP包材报溢管理删除',
        type='2',
        code='store:packaging:excess:remove:yp',
        url='',
        open_type='',
        parent_id='209',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ) ,Power(
        id=213,
        name='YP中间品报溢管理',
        type='1',
        code='store:intermediate:excess:main:yp',
        url='/store/intermediate/excess/yp/',
        open_type='_iframe',
        parent_id='200',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=214,
        name='YP中间品报溢管理增加',
        type='2',
        code='store:intermediate:excess:add:yp',
        url='',
        open_type='',
        parent_id='213',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=215,
        name='YP中间品报溢管理编辑',
        type='2',
        code='store:intermediate:excess:edit:yp',
        url='',
        open_type='',
        parent_id='213',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=216,
        name='YP中间品报溢管理删除',
        type='2',
        code='store:intermediate:excess:remove:yp',
        url='',
        open_type='',
        parent_id='213',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=217,
        name='YP成品报溢管理',
        type='1',
        code='store:finished:excess:main:yp',
        url='/store/finished/excess/yp/',
        open_type='_iframe',
        parent_id='200',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=218,
        name='YP成品报溢管理增加',
        type='2',
        code='store:finished:excess:add:yp',
        url='',
        open_type='',
        parent_id='217',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=219,
        name='YP成品报溢管理编辑',
        type='2',
        code='store:finished:excess:edit:yp',
        url='',
        open_type='',
        parent_id='217',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=220,
        name='YP成品报溢管理删除',
        type='2',
        code='store:finished:excess:remove:yp',
        url='',
        open_type='',
        parent_id='217',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=221,
        name='领料管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=12,
        create_time=now_time,
        enable=1,

    ), Power(
        id=222,
        name='YP原料领料管理',
        type='1',
        code='store:raw:sold:main:yp',
        url='/store/raw/sold/yp/',
        open_type='_iframe',
        parent_id='221',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=223,
        name='YP原料领料管理增加',
        type='2',
        code='store:raw:sold:add:yp',
        url='',
        open_type='',
        parent_id='222',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=224,
        name='YP原料领料管理编辑',
        type='2',
        code='store:raw:sold:edit:yp',
        url='',
        open_type='',
        parent_id='222',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=225,
        name='YP原料领料管理删除',
        type='2',
        code='store:raw:sold:remove:yp',
        url='',
        open_type='',
        parent_id='222',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=226,
        name='YP辅料领料管理',
        type='1',
        code='store:auxiliary:sold:main:yp',
        url='/store/auxiliary/sold/yp/',
        open_type='_iframe',
        parent_id='221',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=227,
        name='YP辅料领料管理增加',
        type='2',
        code='store:auxiliary:sold:add:yp',
        url='',
        open_type='',
        parent_id='226',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=228,
        name='YP辅料领料管理编辑',
        type='2',
        code='store:auxiliary:sold:edit:yp',
        url='',
        open_type='',
        parent_id='226',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=229,
        name='YP辅料领料管理删除',
        type='2',
        code='store:auxiliary:sold:remove:yp',
        url='',
        open_type='',
        parent_id='226',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=230,
        name='YP包材领料管理',
        type='1',
        code='store:packaging:sold:main:yp',
        url='/store/packaging/sold/yp/',
        open_type='_iframe',
        parent_id='221',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=231,
        name='YP包材领料管理增加',
        type='2',
        code='store:packaging:sold:add:yp',
        url='',
        open_type='',
        parent_id='230',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=232,
        name='YP包材领料管理编辑',
        type='2',
        code='store:packaging:sold:edit:yp',
        url='',
        open_type='',
        parent_id='230',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=233,
        name='YP包材领料管理删除',
        type='2',
        code='store:packaging:sold:remove:yp',
        url='',
        open_type='',
        parent_id='230',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ) ,Power(
        id=234,
        name='YP中间品领料管理',
        type='1',
        code='store:intermediate:sold:main:yp',
        url='/store/intermediate/sold/yp/',
        open_type='_iframe',
        parent_id='221',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=235,
        name='YP中间品领料管理增加',
        type='2',
        code='store:intermediate:sold:add:yp',
        url='',
        open_type='',
        parent_id='234',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=236,
        name='YP中间品领料管理编辑',
        type='2',
        code='store:intermediate:sold:edit:yp',
        url='',
        open_type='',
        parent_id='234',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=237,
        name='YP中间品领料管理删除',
        type='2',
        code='store:intermediate:sold:remove:yp',
        url='',
        open_type='',
        parent_id='234',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=238,
        name='YP成品领料管理',
        type='1',
        code='store:finished:sold:main:yp',
        url='/store/finished/sold/yp/',
        open_type='_iframe',
        parent_id='221',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=239,
        name='YP成品领料管理增加',
        type='2',
        code='store:finished:sold:add:yp',
        url='',
        open_type='',
        parent_id='238',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=240,
        name='YP成品领料管理编辑',
        type='2',
        code='store:finished:sold:edit:yp',
        url='',
        open_type='',
        parent_id='238',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=241,
        name='YP成品领料管理删除',
        type='2',
        code='store:finished:sold:remove:yp',
        url='',
        open_type='',
        parent_id='238',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=242,
        name='退料管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=13,
        create_time=now_time,
        enable=1,

    ), Power(
        id=243,
        name='YP原料退料管理',
        type='1',
        code='store:raw:back:main:yp',
        url='/store/raw/back/yp/',
        open_type='_iframe',
        parent_id='242',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=244,
        name='YP原料退料管理增加',
        type='2',
        code='store:raw:back:add:yp',
        url='',
        open_type='',
        parent_id='243',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=245,
        name='YP原料退料管理编辑',
        type='2',
        code='store:raw:back:edit:yp',
        url='',
        open_type='',
        parent_id='243',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=246,
        name='YP原料退料管理删除',
        type='2',
        code='store:raw:back:remove:yp',
        url='',
        open_type='',
        parent_id='243',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=247,
        name='YP辅料退料管理',
        type='1',
        code='store:auxiliary:back:main:yp',
        url='/store/auxiliary/back/yp/',
        open_type='_iframe',
        parent_id='242',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=248,
        name='YP辅料退料管理增加',
        type='2',
        code='store:auxiliary:back:add:yp',
        url='',
        open_type='',
        parent_id='247',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=249,
        name='YP辅料退料管理编辑',
        type='2',
        code='store:auxiliary:back:edit:yp',
        url='',
        open_type='',
        parent_id='247',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=250,
        name='YP辅料退料管理删除',
        type='2',
        code='store:auxiliary:back:remove:yp',
        url='',
        open_type='',
        parent_id='247',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=251,
        name='YP包材退料管理',
        type='1',
        code='store:packaging:back:main:yp',
        url='/store/packaging/back/yp/',
        open_type='_iframe',
        parent_id='242',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=252,
        name='YP包材退料管理增加',
        type='2',
        code='store:packaging:back:add:yp',
        url='',
        open_type='',
        parent_id='251',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=253,
        name='YP包材退料管理编辑',
        type='2',
        code='store:packaging:back:edit:yp',
        url='',
        open_type='',
        parent_id='251',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=254,
        name='YP包材退料管理删除',
        type='2',
        code='store:packaging:back:remove:yp',
        url='',
        open_type='',
        parent_id='251',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ) ,Power(
        id=255,
        name='YP中间品退料管理',
        type='1',
        code='store:intermediate:back:main:yp',
        url='/store/intermediate/back/yp/',
        open_type='_iframe',
        parent_id='242',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=256,
        name='YP中间品退料管理增加',
        type='2',
        code='store:intermediate:back:add:yp',
        url='',
        open_type='',
        parent_id='255',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=257,
        name='YP中间品退料管理编辑',
        type='2',
        code='store:intermediate:back:edit:yp',
        url='',
        open_type='',
        parent_id='255',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=258,
        name='YP中间品退料管理删除',
        type='2',
        code='store:intermediate:back:remove:yp',
        url='',
        open_type='',
        parent_id='255',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=259,
        name='YP成品退料管理',
        type='1',
        code='store:finished:back:main:yp',
        url='/store/finished/back/yp/',
        open_type='_iframe',
        parent_id='242',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=260,
        name='YP成品退料管理增加',
        type='2',
        code='store:finished:back:add:yp',
        url='',
        open_type='',
        parent_id='259',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=261,
        name='YP成品退料管理编辑',
        type='2',
        code='store:finished:back:edit:yp',
        url='',
        open_type='',
        parent_id='259',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=262,
        name='YP成品退料管理删除',
        type='2',
        code='store:finished:back:remove:yp',
        url='',
        open_type='',
        parent_id='259',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=263,
        name='销售管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=14,
        create_time=now_time,
        enable=1,

    ), Power(
        id=264,
        name='YP原料销售管理',
        type='1',
        code='store:raw:sold:main:yp',
        url='/store/raw/sold/yp/',
        open_type='_iframe',
        parent_id='263',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=265,
        name='YP原料销售管理增加',
        type='2',
        code='store:raw:sold:add:yp',
        url='',
        open_type='',
        parent_id='264',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=266,
        name='YP原料销售管理编辑',
        type='2',
        code='store:raw:sold:edit:yp',
        url='',
        open_type='',
        parent_id='264',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=267,
        name='YP原料销售管理删除',
        type='2',
        code='store:raw:sold:remove:yp',
        url='',
        open_type='',
        parent_id='264',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=268,
        name='YP成品销售管理',
        type='1',
        code='store:finished:sold:main:yp',
        url='/store/finished/sold/yp/',
        open_type='_iframe',
        parent_id='263',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=269,
        name='YP成品销售管理增加',
        type='2',
        code='store:finished:sold:add:yp',
        url='',
        open_type='',
        parent_id='268',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=270,
        name='YP成品销售管理编辑',
        type='2',
        code='store:finished:sold:edit:yp',
        url='',
        open_type='',
        parent_id='268',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=271,
        name='YP成品销售管理删除',
        type='2',
        code='store:finished:sold:remove:yp',
        url='',
        open_type='',
        parent_id='268',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=272,
        name='销售退货管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=15,
        create_time=now_time,
        enable=1,

    ), Power(
        id=273,
        name='YP原料销售退货管理',
        type='1',
        code='store:raw:soldback:main:yp',
        url='/store/raw/soldback/yp/',
        open_type='_iframe',
        parent_id='272',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=274,
        name='YP原料销售退货管理增加',
        type='2',
        code='store:raw:soldback:add:yp',
        url='',
        open_type='',
        parent_id='273',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=275,
        name='YP原料销售退货管理编辑',
        type='2',
        code='store:raw:soldback:edit:yp',
        url='',
        open_type='',
        parent_id='273',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=276,
        name='YP原料销售退货管理删除',
        type='2',
        code='store:raw:soldback:remove:yp',
        url='',
        open_type='',
        parent_id='273',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=277,
        name='YP成品销售退货管理',
        type='1',
        code='store:finished:soldback:main:yp',
        url='/store/finished/soldback/yp/',
        open_type='_iframe',
        parent_id='272',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=278,
        name='YP成品销售退货管理增加',
        type='2',
        code='store:finished:soldback:add:yp',
        url='',
        open_type='',
        parent_id='277',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=279,
        name='YP成品销售退货管理编辑',
        type='2',
        code='store:finished:soldback:edit:yp',
        url='',
        open_type='',
        parent_id='277',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=280,
        name='YP成品销售退货管理删除',
        type='2',
        code='store:finished:soldback:remove:yp',
        url='',
        open_type='',
        parent_id='277',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=281,
        name='YP原料销售员',
        type='2',
        code='user:power:raw:yp:solder',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=282,
        name='YP成品销售员',
        type='2',
        code='user:power:finished:yp:solder',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=283,
        name='请验管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=16,
        create_time=now_time,
        enable=1,

    ), Power(
        id=284,
        name='YP原料请验管理',
        type='1',
        code='store:raw:verify:main:yp',
        url='/store/raw/verify/yp/',
        open_type='_iframe',
        parent_id='283',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=285,
        name='YP原料请验管理增加',
        type='2',
        code='store:raw:verify:add:yp',
        url='',
        open_type='',
        parent_id='284',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=286,
        name='YP原料请验管理编辑',
        type='2',
        code='store:raw:verify:edit:yp',
        url='',
        open_type='',
        parent_id='284',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=287,
        name='YP原料请验管理删除',
        type='2',
        code='store:raw:verify:remove:yp',
        url='',
        open_type='',
        parent_id='284',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=288,
        name='YP辅料请验管理',
        type='1',
        code='store:auxiliary:verify:main:yp',
        url='/store/auxiliary/verify/yp/',
        open_type='_iframe',
        parent_id='283',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=289,
        name='YP辅料请验管理增加',
        type='2',
        code='store:auxiliary:verify:add:yp',
        url='',
        open_type='',
        parent_id='288',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=290,
        name='YP辅料请验管理编辑',
        type='2',
        code='store:auxiliary:verify:edit:yp',
        url='',
        open_type='',
        parent_id='288',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=291,
        name='YP辅料请验管理删除',
        type='2',
        code='store:auxiliary:verify:remove:yp',
        url='',
        open_type='',
        parent_id='288',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=292,
        name='YP包材请验管理',
        type='1',
        code='store:packaging:verify:main:yp',
        url='/store/packaging/verify/yp/',
        open_type='_iframe',
        parent_id='283',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=293,
        name='YP包材请验管理增加',
        type='2',
        code='store:packaging:verify:add:yp',
        url='',
        open_type='',
        parent_id='292',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=294,
        name='YP包材请验管理编辑',
        type='2',
        code='store:packaging:verify:edit:yp',
        url='',
        open_type='',
        parent_id='292',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=295,
        name='YP包材请验管理删除',
        type='2',
        code='store:packaging:verify:remove:yp',
        url='',
        open_type='',
        parent_id='292',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ) ,Power(
        id=296,
        name='YP中间品请验管理',
        type='1',
        code='store:intermediate:verify:main:yp',
        url='/store/intermediate/verify/yp/',
        open_type='_iframe',
        parent_id='283',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=297,
        name='YP中间品请验管理增加',
        type='2',
        code='store:intermediate:verify:add:yp',
        url='',
        open_type='',
        parent_id='296',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=298,
        name='YP中间品请验管理编辑',
        type='2',
        code='store:intermediate:verify:edit:yp',
        url='',
        open_type='',
        parent_id='296',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=299,
        name='YP中间品请验管理删除',
        type='2',
        code='store:intermediate:verify:remove:yp',
        url='',
        open_type='',
        parent_id='296',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=300,
        name='YP成品请验管理',
        type='1',
        code='store:finished:verify:main:yp',
        url='/store/finished/verify/yp/',
        open_type='_iframe',
        parent_id='283',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=301,
        name='YP成品请验管理增加',
        type='2',
        code='store:finished:verify:add:yp',
        url='',
        open_type='',
        parent_id='300',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=302,
        name='YP成品请验管理编辑',
        type='2',
        code='store:finished:verify:edit:yp',
        url='',
        open_type='',
        parent_id='300',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=303,
        name='YP成品请验管理删除',
        type='2',
        code='store:finished:verify:remove:yp',
        url='',
        open_type='',
        parent_id='300',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=304,
        name='取样管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=17,
        create_time=now_time,
        enable=1,

    ), Power(
        id=305,
        name='YP原料取样管理',
        type='1',
        code='store:raw:sample:main:yp',
        url='/store/raw/sample/yp/',
        open_type='_iframe',
        parent_id='304',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=306,
        name='YP原料取样管理增加',
        type='2',
        code='store:raw:sample:add:yp',
        url='',
        open_type='',
        parent_id='305',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=307,
        name='YP原料取样管理编辑',
        type='2',
        code='store:raw:sample:edit:yp',
        url='',
        open_type='',
        parent_id='305',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=308,
        name='YP原料取样管理删除',
        type='2',
        code='store:raw:sample:remove:yp',
        url='',
        open_type='',
        parent_id='305',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=309,
        name='YP辅料取样管理',
        type='1',
        code='store:auxiliary:sample:main:yp',
        url='/store/auxiliary/sample/yp/',
        open_type='_iframe',
        parent_id='304',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=310,
        name='YP辅料取样管理增加',
        type='2',
        code='store:auxiliary:sample:add:yp',
        url='',
        open_type='',
        parent_id='309',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=311,
        name='YP辅料取样管理编辑',
        type='2',
        code='store:auxiliary:sample:edit:yp',
        url='',
        open_type='',
        parent_id='309',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=312,
        name='YP辅料取样管理删除',
        type='2',
        code='store:auxiliary:sample:remove:yp',
        url='',
        open_type='',
        parent_id='309',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=313,
        name='YP包材取样管理',
        type='1',
        code='store:packaging:sample:main:yp',
        url='/store/packaging/sample/yp/',
        open_type='_iframe',
        parent_id='304',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=314,
        name='YP包材取样管理增加',
        type='2',
        code='store:packaging:sample:add:yp',
        url='',
        open_type='',
        parent_id='313',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=315,
        name='YP包材取样管理编辑',
        type='2',
        code='store:packaging:sample:edit:yp',
        url='',
        open_type='',
        parent_id='314',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=316,
        name='YP包材取样管理删除',
        type='2',
        code='store:packaging:sample:remove:yp',
        url='',
        open_type='',
        parent_id='314',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ) ,Power(
        id=317,
        name='YP中间品取样管理',
        type='1',
        code='store:intermediate:sample:main:yp',
        url='/store/intermediate/sample/yp/',
        open_type='_iframe',
        parent_id='304',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=318,
        name='YP中间品取样管理增加',
        type='2',
        code='store:intermediate:sample:add:yp',
        url='',
        open_type='',
        parent_id='317',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=319,
        name='YP中间品取样管理编辑',
        type='2',
        code='store:intermediate:sample:edit:yp',
        url='',
        open_type='',
        parent_id='318',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=320,
        name='YP中间品取样管理删除',
        type='2',
        code='store:intermediate:sample:remove:yp',
        url='',
        open_type='',
        parent_id='318',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=321,
        name='YP成品取样管理',
        type='1',
        code='store:finished:sample:main:yp',
        url='/store/finished/sample/yp/',
        open_type='_iframe',
        parent_id='304',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=322,
        name='YP成品取样管理增加',
        type='2',
        code='store:finished:sample:add:yp',
        url='',
        open_type='',
        parent_id='321',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=323,
        name='YP成品取样管理编辑',
        type='2',
        code='store:finished:sample:edit:yp',
        url='',
        open_type='',
        parent_id='321',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=324,
        name='YP成品取样管理删除',
        type='2',
        code='store:finished:sample:remove:yp',
        url='',
        open_type='',
        parent_id='321',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=325,
        name='检验管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=19,
        create_time=now_time,
        enable=1,

    ), Power(
        id=326,
        name='YP原料检验管理',
        type='1',
        code='store:raw:test:main:yp',
        url='/store/raw/test/yp/',
        open_type='_iframe',
        parent_id='325',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=327,
        name='YP原料检验管理增加',
        type='2',
        code='store:raw:test:add:yp',
        url='',
        open_type='',
        parent_id='326',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=328,
        name='YP原料检验管理编辑',
        type='2',
        code='store:raw:test:edit:yp',
        url='',
        open_type='',
        parent_id='326',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=329,
        name='YP原料检验管理删除',
        type='2',
        code='store:raw:test:remove:yp',
        url='',
        open_type='',
        parent_id='326',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=330,
        name='YP辅料检验管理',
        type='1',
        code='store:auxiliary:test:main:yp',
        url='/store/auxiliary/test/yp/',
        open_type='_iframe',
        parent_id='325',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=331,
        name='YP辅料检验管理增加',
        type='2',
        code='store:auxiliary:test:add:yp',
        url='',
        open_type='',
        parent_id='330',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=332,
        name='YP辅料检验管理编辑',
        type='2',
        code='store:auxiliary:test:edit:yp',
        url='',
        open_type='',
        parent_id='330',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=333,
        name='YP辅料检验管理删除',
        type='2',
        code='store:auxiliary:test:remove:yp',
        url='',
        open_type='',
        parent_id='330',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=334,
        name='YP包材检验管理',
        type='1',
        code='store:packaging:test:main:yp',
        url='/store/packaging/test/yp/',
        open_type='_iframe',
        parent_id='325',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=335,
        name='YP包材检验管理增加',
        type='2',
        code='store:packaging:test:add:yp',
        url='',
        open_type='',
        parent_id='334',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=336,
        name='YP包材检验管理编辑',
        type='2',
        code='store:packaging:test:edit:yp',
        url='',
        open_type='',
        parent_id='334',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=337,
        name='YP包材检验管理删除',
        type='2',
        code='store:packaging:test:remove:yp',
        url='',
        open_type='',
        parent_id='334',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ) ,Power(
        id=338,
        name='YP中间品检验管理',
        type='1',
        code='store:intermediate:test:main:yp',
        url='/store/intermediate/test/yp/',
        open_type='_iframe',
        parent_id='325',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=339,
        name='YP中间品检验管理增加',
        type='2',
        code='store:intermediate:test:add:yp',
        url='',
        open_type='',
        parent_id='338',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=340,
        name='YP中间品检验管理编辑',
        type='2',
        code='store:intermediate:test:edit:yp',
        url='',
        open_type='',
        parent_id='338',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=341,
        name='YP中间品检验管理删除',
        type='2',
        code='store:intermediate:test:remove:yp',
        url='',
        open_type='',
        parent_id='338',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=342,
        name='YP成品检验管理',
        type='1',
        code='store:finished:test:main:yp',
        url='/store/finished/test/yp/',
        open_type='_iframe',
        parent_id='325',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=343,
        name='YP成品检验管理增加',
        type='2',
        code='store:finished:test:add:yp',
        url='',
        open_type='',
        parent_id='342',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=344,
        name='YP成品检验管理编辑',
        type='2',
        code='store:finished:test:edit:yp',
        url='',
        open_type='',
        parent_id='342',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=345,
        name='YP成品检验管理删除',
        type='2',
        code='store:finished:test:remove:yp',
        url='',
        open_type='',
        parent_id='342',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=346,
        name='放行管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=20,
        create_time=now_time,
        enable=1,

    ), Power(
        id=347,
        name='YP原料放行管理',
        type='1',
        code='store:raw:release:main:yp',
        url='/store/raw/release/yp/',
        open_type='_iframe',
        parent_id='346',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=348,
        name='YP原料放行管理增加',
        type='2',
        code='store:raw:release:add:yp',
        url='',
        open_type='',
        parent_id='346',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=349,
        name='YP原料放行管理编辑',
        type='2',
        code='store:raw:release:edit:yp',
        url='',
        open_type='',
        parent_id='348',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=350,
        name='YP原料放行管理删除',
        type='2',
        code='store:raw:release:remove:yp',
        url='',
        open_type='',
        parent_id='348',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=351,
        name='YP辅料放行管理',
        type='1',
        code='store:auxiliary:release:main:yp',
        url='/store/auxiliary/release/yp/',
        open_type='_iframe',
        parent_id='346',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=352,
        name='YP辅料放行管理增加',
        type='2',
        code='store:auxiliary:release:add:yp',
        url='',
        open_type='',
        parent_id='351',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=353,
        name='YP辅料放行管理编辑',
        type='2',
        code='store:auxiliary:release:edit:yp',
        url='',
        open_type='',
        parent_id='351',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=354,
        name='YP辅料放行管理删除',
        type='2',
        code='store:auxiliary:release:remove:yp',
        url='',
        open_type='',
        parent_id='351',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=355,
        name='YP包材放行管理',
        type='1',
        code='store:packaging:release:main:yp',
        url='/store/packaging/release/yp/',
        open_type='_iframe',
        parent_id='346',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=356,
        name='YP包材放行管理增加',
        type='2',
        code='store:packaging:release:add:yp',
        url='',
        open_type='',
        parent_id='355',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=357,
        name='YP包材放行管理编辑',
        type='2',
        code='store:packaging:release:edit:yp',
        url='',
        open_type='',
        parent_id='355',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=358,
        name='YP包材放行管理删除',
        type='2',
        code='store:packaging:release:remove:yp',
        url='',
        open_type='',
        parent_id='355',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ) ,Power(
        id=359,
        name='YP中间品放行管理',
        type='1',
        code='store:intermediate:release:main:yp',
        url='/store/intermediate/release/yp/',
        open_type='_iframe',
        parent_id='346',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=360,
        name='YP中间品放行管理增加',
        type='2',
        code='store:intermediate:release:add:yp',
        url='',
        open_type='',
        parent_id='359',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=361,
        name='YP中间品放行管理编辑',
        type='2',
        code='store:intermediate:release:edit:yp',
        url='',
        open_type='',
        parent_id='359',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=362,
        name='YP中间品放行管理删除',
        type='2',
        code='store:intermediate:release:remove:yp',
        url='',
        open_type='',
        parent_id='359',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=363,
        name='YP成品放行管理',
        type='1',
        code='store:finished:release:main:yp',
        url='/store/finished/release/yp/',
        open_type='_iframe',
        parent_id='346',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=364,
        name='YP成品放行管理增加',
        type='2',
        code='store:finished:release:add:yp',
        url='',
        open_type='',
        parent_id='363',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=365,
        name='YP成品放行管理编辑',
        type='2',
        code='store:finished:release:edit:yp',
        url='',
        open_type='',
        parent_id='363',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=366,
        name='YP成品放行管理删除',
        type='2',
        code='store:finished:release:remove:yp',
        url='',
        open_type='',
        parent_id='363',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ),Power(
        id=367,
        name='期初入库管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon-set-fill',
        sort=10,
        create_time=now_time,
        enable=1,

    ), Power(
        id=368,
        name='YP原料期初入库',
        type='1',
        code='store:raw:begin:main:yp',
        url='/store/raw/begin/yp/',
        open_type='_iframe',
        parent_id='367',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=369,
        name='YP原料期初入库增加',
        type='2',
        code='store:raw:begin:add:yp',
        url='',
        open_type='',
        parent_id='368',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=370,
        name='YP原料期初入库编辑',
        type='2',
        code='store:raw:begin:edit:yp',
        url='',
        open_type='',
        parent_id='368',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=371,
        name='YP原料期初入库删除',
        type='2',
        code='store:raw:begin:remove:yp',
        url='',
        open_type='',
        parent_id='368',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=372,
        name='YP辅料期初入库',
        type='1',
        code='store:auxiliary:begin:main:yp',
        url='/store/auxiliary/begin/yp/',
        open_type='_iframe',
        parent_id='367',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=373,
        name='YP辅料入库增加',
        type='2',
        code='store:auxiliary:begin:add:yp',
        url='',
        open_type='',
        parent_id='372',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=374,
        name='YP辅料入库编辑',
        type='2',
        code='store:auxiliary:begin:edit:yp',
        url='',
        open_type='',
        parent_id='372',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=375,
        name='YP辅料期初入库删除',
        type='2',
        code='store:auxiliary:begin:remove:yp',
        url='',
        open_type='',
        parent_id='372',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=376,
        name='YP包材期初入库',
        type='1',
        code='store:packaging:begin:main:yp',
        url='/store/packaging/begin/yp/',
        open_type='_iframe',
        parent_id='367',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=377,
        name='YP包材期初入库增加',
        type='2',
        code='store:packaging:begin:add:yp',
        url='',
        open_type='',
        parent_id='376',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=378,
        name='YP包材期初入库编辑',
        type='2',
        code='store:packaging:begin:edit:yp',
        url='',
        open_type='',
        parent_id='377',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=379,
        name='YP包材期初入库删除',
        type='2',
        code='store:packaging:begin:remove:yp',
        url='',
        open_type='',
        parent_id='377',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=380,
        name='YP中间品期初入库',
        type='1',
        code='store:intermediate:begin:main:yp',
        url='/store/intermediate/begin/yp/',
        open_type='_iframe',
        parent_id='367',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=381,
        name='YP中间品期初入库增加',
        type='2',
        code='store:intermediate:begin:add:yp',
        url='',
        open_type='',
        parent_id='380',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=382,
        name='YP中间品期初入库编辑',
        type='2',
        code='store:intermediate:begin:edit:yp',
        url='',
        open_type='',
        parent_id='380',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=383,
        name='YP中间品期初入库删除',
        type='2',
        code='store:intermediate:begin:remove:yp',
        url='',
        open_type='',
        parent_id='380',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=384,
        name='YP成品期初入库',
        type='1',
        code='store:finished:begin:main:yp',
        url='/store/finished/begin/yp/',
        open_type='_iframe',
        parent_id='367',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=385,
        name='YP成品期初入库增加',
        type='2',
        code='store:finished:begin:add:yp',
        url='',
        open_type='',
        parent_id='384',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=386,
        name='YP成品期初入库编辑',
        type='2',
        code='store:finished:begin:edit:yp',
        url='',
        open_type='',
        parent_id='384',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=387,
        name='YP成品期初入库删除',
        type='2',
        code='store:finished:begin:remove:yp',
        url='',
        open_type='',
        parent_id='384',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=388,
        name='YP原料取样员',
        type='2',
        code='user:power:raw:yp:sampler',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=389,
        name='YP原料检验员',
        type='2',
        code='user:power:raw:yp:tester',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=390,
        name='YP原料放行员',
        type='2',
        code='user:power:raw:yp:releaser',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=391,
        name='YP辅料库管员',
        type='2',
        code='user:power:auxiliary:yp:keeper',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=392,
        name='YP辅料QA',
        type='2',
        code='user:power:auxiliary:yp:qa',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=393,
        name='YP辅料采购员',
        type='2',
        code='user:power:auxiliary:yp:buyer',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=394,
        name='YP辅料取样员',
        type='2',
        code='user:power:auxiliary:yp:sampler',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=395,
        name='YP辅料检验员',
        type='2',
        code='user:power:auxiliary:yp:tester',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=396,
        name='YP辅料放行员',
        type='2',
        code='user:power:auxiliary:yp:releaser',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=397,
        name='YP包材库管员',
        type='2',
        code='user:power:packaging:yp:keeper',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=398,
        name='YP包材QA',
        type='2',
        code='user:power:packaging:yp:qa',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=399,
        name='YP包材采购员',
        type='2',
        code='user:power:packaging:yp:buyer',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=400,
        name='YP包材取样员',
        type='2',
        code='user:power:packaging:yp:sampler',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=401,
        name='YP包材检验员',
        type='2',
        code='user:power:packaging:yp:tester',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=402,
        name='YP包材放行员',
        type='2',
        code='user:power:packaging:yp:releaser',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=403,
        name='检验方法管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=21,
        create_time=now_time,
        enable=1,

    ), Power(
        id=404,
        name='YP检验方法管理',
        type='1',
        code='test:method:main:yp',
        url='/test/method/yp/',
        open_type='_iframe',
        parent_id='403',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=405,
        name='YP检验方法增加',
        type='2',
        code='test:method:add:yp',
        url='',
        open_type='',
        parent_id='404',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=406,
        name='YP检验方法编辑',
        type='2',
        code='test:method:edit:yp',
        url='',
        open_type='',
        parent_id='404',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=407,
        name='YP检验方法删除',
        type='2',
        code='test:method:remove:yp',
        url='',
        open_type='',
        parent_id='404',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=408,
        name='检验标准管理',
        type='0',
        code='',
        url=None,
        open_type=None,
        parent_id='0',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=22,
        create_time=now_time,
        enable=1,

    ), Power(
        id=409,
        name='YP原料检验标准管理',
        type='1',
        code='test:raw:standard:main:yp',
        url='/test/raw/standard/yp/',
        open_type='_iframe',
        parent_id='408',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=410,
        name='YP原料检验标准管理增加',
        type='2',
        code='test:raw:standard:add:yp',
        url='',
        open_type='',
        parent_id='409',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=411,
        name='YP原料检验标准管理编辑',
        type='2',
        code='test:raw:standard:edit:yp',
        url='',
        open_type='',
        parent_id='409',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=412,
        name='YP原料检验标准管理删除',
        type='2',
        code='test:raw:standard:remove:yp',
        url='',
        open_type='',
        parent_id='409',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=413,
        name='YP辅料检验标准管理',
        type='1',
        code='test:auxiliary:standard:main:yp',
        url='/test/auxiliary/standard/yp/',
        open_type='_iframe',
        parent_id='408',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=414,
        name='YP辅料检验标准管理增加',
        type='2',
        code='test:auxiliary:standard:add:yp',
        url='',
        open_type='',
        parent_id='413',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=415,
        name='YP辅料检验标准管理编辑',
        type='2',
        code='test:auxiliary:standard:edit:yp',
        url='',
        open_type='',
        parent_id='413',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=416,
        name='YP辅料检验标准管理删除',
        type='2',
        code='test:auxiliary:standard:remove:yp',
        url='',
        open_type='',
        parent_id='413',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=417,
        name='YP包材检验标准管理',
        type='1',
        code='test:packaging:standard:main:yp',
        url='/test/packaging/standard/yp/',
        open_type='_iframe',
        parent_id='408',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=418,
        name='YP包材检验标准管理增加',
        type='2',
        code='test:packaging:standard:add:yp',
        url='',
        open_type='',
        parent_id='417',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=419,
        name='YP包材检验标准管理编辑',
        type='2',
        code='test:packaging:standard:edit:yp',
        url='',
        open_type='',
        parent_id='417',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=420,
        name='YP包材检验标准管理删除',
        type='2',
        code='test:packaging:standard:remove:yp',
        url='',
        open_type='',
        parent_id='417',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=421,
        name='YP中间品检验标准管理',
        type='1',
        code='test:intermediate:standard:main:yp',
        url='/test/intermediate/standard/yp/',
        open_type='_iframe',
        parent_id='408',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=4,
        create_time=now_time,
        enable=1,

    ), Power(
        id=422,
        name='YP中间品检验标准管理增加',
        type='2',
        code='test:intermediate:standard:add:yp',
        url='',
        open_type='',
        parent_id='421',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=423,
        name='YP中间品检验标准管理编辑',
        type='2',
        code='test:intermediate:standard:edit:yp',
        url='',
        open_type='',
        parent_id='421',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=424,
        name='YP中间品检验标准管理删除',
        type='2',
        code='test:intermediate:standard:remove:yp',
        url='',
        open_type='',
        parent_id='421',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=425,
        name='YP成品检验标准管理',
        type='1',
        code='test:finished:standard:main:yp',
        url='/test/finished/standard/yp/',
        open_type='_iframe',
        parent_id='408',
        icon='layui-icon layui-icon layui-icon layui-icon layui-icon-rate',
        sort=5,
        create_time=now_time,
        enable=1,

    ), Power(
        id=426,
        name='YP成品检验标准管理增加',
        type='2',
        code='test:finished:standard:add:yp',
        url='',
        open_type='',
        parent_id='425',
        icon='layui-icon layui-icon-add-circle',
        sort=1,
        create_time=now_time,
        enable=1,

    ), Power(
        id=427,
        name='YP成品检验标准管理编辑',
        type='2',
        code='test:finished:standard:edit:yp',
        url='',
        open_type='',
        parent_id='425',
        icon='layui-icon layui-icon-rate',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=428,
        name='YP成品检验标准管理删除',
        type='2',
        code='test:intermediate:standard:remove:yp',
        url='',
        open_type='',
        parent_id='425',
        icon='',
        sort=3,
        create_time=now_time,
        enable=1,

    ), Power(
        id=429,
        name='YP原料检验复核员',
        type='2',
        code='user:power:raw:yp:test:reviewer',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=430,
        name='YP辅料检验复核员',
        type='2',
        code='user:power:auxiliary:yp:test:reviewer',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=431,
        name='YP包材检验复核员',
        type='2',
        code='user:power:packaging:yp:test:reviewer',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=432,
        name='YP中间品检验复核员',
        type='2',
        code='user:power:intermediate:yp:test:reviewer',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=433,
        name='YP成品检验复核员',
        type='2',
        code='user:power:finished:yp:test:reviewer',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=434,
        name='YP原料检验主管',
        type='2',
        code='user:power:raw:yp:test:director',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=435,
        name='YP辅料检验主管',
        type='2',
        code='user:power:auxiliary:yp:test:director',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=436,
        name='YP包材检验主管',
        type='2',
        code='user:power:packaging:yp:test:director',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=437,
        name='YP中间品检验主管',
        type='2',
        code='user:power:intermediate:yp:test:director',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    ), Power(
        id=438,
        name='YP成品检验主管',
        type='2',
        code='user:power:finished:yp:test:director',
        url='',
        open_type='',
        parent_id='141',
        icon='',
        sort=2,
        create_time=now_time,
        enable=1,

    )

]
dicttype=[
            DictType(
            id=1,
            type_name='YL原料单位',
            type_code='unitYPyl',
            description='单位',
            enable=1
            ),DictType(
            id=2,
            type_name='YL辅料单位',
            type_code='unitYPfl',
            description='单位',
            enable=1
            ),DictType(
            id=3,
            type_name='YL包材单位',
            type_code='unitYPbc',
            description='单位',
            enable=1
            ),DictType(
            id=4,
            type_name='YL成品单位',
            type_code='unitYPcp',
            description='单位',
            enable=1
            ),DictType(
            id=5,
            type_name='YL半成品单位',
            type_code='unitYPbcp',
            description='单位',
            enable=1
            )
]
dictdata=[
            DictData(
            id=1,
            data_label='Kg',
            data_value='1',
            data_rel='1',
            type_code='unitYPyl',
            enable=1
            ),DictData(
                id=2,
                data_label='对',
                data_value='2',
                data_rel='1',
                type_code='unitYPyl',
                enable=1
            ),DictData(
                id=3,
                data_label='条',
                data_value='3',
                data_rel='1',
                type_code='unitYPyl',
                enable=1
            )
]
sysconfigdata= [
    SysConfig(
        id=1,
        name='正常模式',
        code='mode:normal',
        enable=1,
        remark='',
        details='界面显示:正常模式(默认开启），关闭则为安全模式',
        sort=1,

    )

]

def add_user_role():
    admin_role = Role.query.filter_by(id=1).first()
    admin_user = User.query.filter_by(id=1).first()
    admin_user.role.append(admin_role)
    test_role = Role.query.filter_by(id=2).first()
    test_user = User.query.filter_by(id=2).first()
    test_user.role.append(test_role)
    db.session.commit()


def add_role_power():
    # admin_powers = Power.query.filter(Power.id.in_([1, 3, 4, 9, 12, 13, 17, 18, 44, 48,142,143,144,388,
    #                                                 389,390,391,392,393,394,395,396,397,398,399,400,401,402])).all()
    admin_powers = Power.query.all()
    admin_user = Role.query.filter_by(id=2).first()
    for i in admin_powers:
        admin_user.power.append(i)

    db.session.commit()
def add_test_data():
    '''商品测试数据'''
    add_test_goods()
    '''货位测试数据'''
    add_locations()
    '''原料入库测试数据'''
    add_test_store()
def add_test_goods():
    goods=[
        RawYPModel(
            id=1,
            品名='白芍',
            简拼 = 'BS',
            全拼 = 'BAISHAO',
            默认规格 = '统',
            代码 = '1001',
            状态 =1,
            版本号 = 1,
            默认产地 = '安徽亳州',
            归属类别 = '植物类',
            执行标准 = '《中国药典》2020年版',
            检验标准 = '《中国药典》2020年版一部及四部 内控标准',
            贮存条件 ='常温',
            药典贮存条件 = '',
        ),RawYPModel(
            id=2,
            品名='牡丹皮',
            简拼 = 'MDP',
            全拼 = 'MUDANPI',
            默认规格 = '统',
            代码 = '1002',
            状态 =1,
            版本号 = 1,
            默认产地 = '四川亳州',
            归属类别 = '植物类',
            执行标准 = '《中国药典》2020年版',
            检验标准 = '《中国药典》2020年版一部及四部 内控标准',
            贮存条件 ='常温',
            药典贮存条件 = '',
        ),

    ]
    db.session.add_all(goods)
    db.session.commit()

    sup=SupplierRawYPModel(
        id = 1,
        供应商名 = '白芍供应商',


        联系人='联系人1',
        联系电话='联系电话1',
        身份信息='100000001',
        状态=1)
    sup.goods.append(goods[0])
    db.session.add(sup)

    sup = SupplierRawYPModel(
    id=2,
    供应商名='牡丹皮供应商',


    联系人='联系人2',
    联系电话='联系电话1',
    身份信息='100000002',
    状态=1)
    sup.goods.append(goods[1])
    db.session.add(sup)
    sup = SupplierRawYPModel(
        id=3,
        供应商名='供应商3',


        联系人='联系人3',
        联系电话='联系电话3',
        身份信息='100000003',
        状态=1)
    sup.goods.extend(goods)
    db.session.add(sup)
    db.session.commit()

def add_locations():
    locations=[
        LocationRawYP(
            id=1,
            name='常温原料库',
            type = '0',
            code = 'cw',
            parent_id = 0,
            icon = 'layui-icon layui-icon-rate',
            sort=0,
            enable =1,

        ),LocationRawYP(
            id=2,
            name='阴凉原料库',
            type = '0',
            code = 'yl',
            parent_id = 0,
            icon = 'layui-icon layui-icon-rate',
            sort=0,
            enable =1,

        ),LocationRawYP(
            id=3,
            name='A区',
            type = '1',
            code = 'cw-a',
            parent_id = 1,
            icon = 'layui-icon layui-icon-rate',
            sort=0,
            enable =1,

        ),LocationRawYP(
            id=4,
            name='A区-2',
            type = '2',
            code = 'cw-a-2',
            parent_id = 3,
            icon = 'layui-icon layui-icon-rate',
            sort=0,
            enable =1,

        ),LocationRawYP(
            id=5,
            name='B区',
            type = '1',
            code = 'yl-b',
            parent_id = 2,
            icon = 'layui-icon layui-icon-rate',
            sort=0,
            enable =1,

        ),LocationRawYP(
            id=6,
            name='B区-2',
            type = '2',
            code = 'yl-b-2',
            parent_id = 5,
            icon = 'layui-icon layui-icon-rate',
            sort=0,
            enable =1,

        )

    ]
    db.session.add_all(locations)
    db.session.commit()

def add_test_store():

    stores=[StoreRawYPModel(
        id=1,
        raw_id=1,
        supplier_id=1,
        store_number=100,
        price=12.5,
        residual_number=99.95,
        unit_id=1,
        type='入库单',
        date_time='2025-02-11',
        产地='安徽亳州市',
        规格='统',
        批号='1001-2502001',
        user_keeper_id=2
    ),StoreRawYPModel(
        id=2,
        raw_id=2,
        supplier_id=2,
        store_number=23,
        price=11,
        residual_number=22.8,
        unit_id=1,
        type='入库单',
        date_time='2025-02-11',
        产地='四川',
        规格='选',
        批号='1002-2502001',
        user_keeper_id=2
    ),StoreRawYPModel_location(
        id=1,
        store_id=1,
        type='入库单',
        store_number=100,
        stock_number=99.95,
        location_id=1,
    ),StoreRawYPModel_location(
        id=2,
        store_id=2,
        type='入库单',
        store_number=23,
        stock_number=22.8,
        location_id=2,
    )]
    verifys=[VerifyRawYPModel(
        id=1,
        verify_dh='ZL_VF_2025_02_0001',
        store_location_id=1,
        verify_number=100,
        date_time='2025-02-11',
        user_verifyer_id=2,
        verify_project='全项检验',
        verify_department='仓储部',
        verify_type='正常请验'
    ),VerifyRawYPModel(
        id=2,
        verify_dh='ZL_VF_2025_02_0002',
        store_location_id=2,
        verify_number=23,
        date_time='2025-02-11',
        user_verifyer_id=2,
        verify_project='全项检验',
        verify_department='仓储部',
        verify_type='临期请验'
    ),VerifyRawYPModelSample(
        id=1,
        verify_dh='ZL_VF_SP_2025_02_0001',
        产地='安徽亳州',
        规格='统',
        批号='XY1001-2502001',
        单位='Kg',
        raw_id=1,
        verify_number=1,
        date_time='2025-02-12',
        user_verifyer_id=2,
        verify_project='部分检验',
        verify_department='仓储部',
        verify_type='小样请验',
        remark='水分、灰分就行'
    ),SampleRawYPModel(
        id=1,
        sample_dh='ZL_SP_2025_02_0001',
        verify_id=1,
        sample_number=0.05,
        date_time='2025-02-12',
        user_sampler_id=2,
        sample_project='全项检验',
        sample_department='仓储部',
        sample_type='正常取样',

    ),SampleRawYPModel(
        id=2,
        sample_dh='ZL_SP_2025_02_0002',
        verify_id=2,
        sample_number=0.2,
        date_time='2025-02-12',
        user_sampler_id=2,
        sample_project='全项检验',
        sample_department='仓储部',
        sample_type='临期取样',

    ),SampleRawYPModelSample(
        id=1,
        sample_dh='ZL_SP_SP_2025_02_0001',
        verify_id=1,
        sample_number=0.5,
        date_time='2025-02-12',
        user_sampler_id=2,
        sample_project='全项检验',
        sample_department='仓储部',
        sample_type='小样取样',

    )
    ]
    db.session.add_all(stores)
    db.session.commit()
    db.session.add_all(verifys)
    db.session.commit()
def clear_datebase():
    SampleRawYPModelSample.query.delete()
    SampleRawYPModel.query.delete()
    VerifyRawYPModelSample.query.delete()
    VerifyRawYPModel.query.delete()
    StoreRawYPLossModel.query.delete()
    StoreRawYPExcessModel.query.delete()
    StoreRawYPReturnSupplierModel.query.delete()
    StoreRawYPModel_location.query.delete()
    StoreRawYPFilesModel.query.delete()
    StoreRawYPModel.query.delete()
    DictData.query.delete()
    DictType.query.delete()
    users = User.query.all()
    for user in users:
        user.role = []
        # 删除角色
        db.session.delete(user)

    roles = Role.query.all()
    for role in roles:
        role.power = []
        db.session.delete(role)
    Dept.query.delete()
    Power.query.delete()
    SysConfig.query.delete()

    supplierraws=SupplierRawYPModel.query.all()
    for su in supplierraws:
        su.goods=[]
        db.session.delete(su)
    RawYPModel.query.delete()
    LocationRawYP.query.delete()
    db.session.commit()

@admin_cli.command("init")
def init_db():
    print('开始...')
    clear_datebase()
    print("清楚原有数据")
    db.session.add_all(userdata)
    print("加载系统必须用户数据")
    db.session.add_all(roledata)
    print("加载系统必须角色数据")
    db.session.add_all(deptdata)
    print("加载系统必须部门数据")
    db.session.add_all(powerdata)
    print("加载系统必须权限数据")
    db.session.add_all(dicttype)
    db.session.commit()
    db.session.add_all(dictdata)
    print("加载系统必须数据字典")
    db.session.add_all(sysconfigdata)
    print("加载系统必须配置数据")
    db.session.commit()
    print("基础数据存入")
    add_user_role()
    print("用户角色数据存入")
    add_role_power()
    print("角色权限数据存入")
    add_test_data()
    print("测试数据存入")

    print("数据初始化完成,请使用run脚本运行")
